﻿using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.FileProviders;

namespace K9Nano.LayIM
{
    public static class RazorStartupExtensions
    {
        public static IApplicationBuilder UseLayIMRazor(this IApplicationBuilder app)
        {
            app.UseStaticFiles(new StaticFileOptions
            {
                RequestPath = "/im-static",
                FileProvider = new EmbeddedFileProvider(typeof(RazorStartupExtensions).Assembly, "K9Nano.LayIM.Razor.wwwroot")
            });

            app.UseLayIM();

            return app;
        }
    }
}